package server;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import org.jgroups.Message;

public class Action implements ActionListener {
	
	
	
	public void actionPerformed(ActionEvent e) {     
		
	    
		if(e.getSource() == ServerMain.fenetre.getB()) {
			
			
		
			System.out.println(ServerMain.fenetre.getJtf().getText());	 		
			
			Message msg1=new Message(null,null,ServerMain.fenetre.getJtf().getText());
			
			try {
				ServerMain.channel.send(msg1);
			} catch (Exception e1) {
				// TODO Auto-generated catch block
				e1.printStackTrace();
			}
			
			ServerMain.fenetre.getJtf().setText(null);
			
		
			}		
     }
}